/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.anorien.dmo;

import java.util.ArrayList;

/**
 *
 * @author David Miguel Antunes <davidmiguel [ at ] antunes.net>
 */
public class Function {

    private String name;
    private boolean locked = false;
    private ArrayList<Parameter> parameters;

    public Function() {
    }

    public Function(String name, ArrayList<Parameter> parameters) {
        this.name = name;
        this.parameters = parameters;
    }

    public String getName() {
        return name;
    }

    public ArrayList<Parameter> getParameters() {
        return parameters;
    }

    public void setParameters(ArrayList<Parameter> parameters) {
        if (!locked) {
            this.parameters = parameters;
        }
    }

    public void setName(String name) {
        if (!locked) {
            this.name = name;
        }
    }

    public boolean isLocked() {
        return locked;
    }

    public void setLocked(boolean locked) {
        this.locked = locked;
    }

    @Override
    public String toString() {
        return name + (locked ? " (locked)" : "");
    }
}
